﻿using AutoMapper;
using Microsoft.Xna.Framework.Input;
using Soundteller.Application.Facade.Contracts;
using Soundteller.Audio.Model;
using Soundteller.AudioVisual.Model;
using Soundteller.Visual.Model;

namespace Soundteller.Application.Facade.Mappers
{
    public static class MappingConfiguration
    {
        public static void Configure()
        {
            Mapper.CreateMap<GraphicBase, XnaGraphic>().ConvertUsing<ImageGraphicToXnaGraphicConverter>();
            Mapper.CreateMap<XnaGraphic, GraphicBase>().ConvertUsing<XnaGraphicToImageGraphicConverter>();

            Mapper.CreateMap<Sound, XnaSound>().ConvertUsing<SoundToXnaSoundConverter>();

            Mapper.CreateMap<MouseState, PadTouchArguments>()
                .ForMember(destination => destination.X, x => x.MapFrom(source => source.X))
                .ForMember(destination => destination.Y, y => y.MapFrom(source => source.Y)
            );

            Mapper.AssertConfigurationIsValid();
        }
    }
}